//通过函数返回最新的Variable变量表 更新样式

const generateNavBar = (Variables)=>{
    return {
        //导航栏高度
        navBarHeight : Variables.sizeHeightXl,
        //标题文字字号
        navBarTitleFontSize: Variables.fontSizeXl,
        //标题文字颜色
        navBarTitleColor:Variables.colorColdgray3,
        //菜单文本字号
        navBarRightTextFontSize: Variables.fontSizeBase,
        //菜单文本颜色
        navBarRightTextColor:Variables.colorColdgray3,
        //左侧图标大小
        navBarLeftIcon : Variables.sizeIconM,
        //菜单图标的高度
        navBarRightIcon:Variables.sizeIconM,
        //背景色
        navBarBg : Variables.colorWhite1
    }
}

const getNavBarStyle =(Variables)=>{
    let  navBarStyle = generateNavBar(Variables)
    let styles = {
        flexContainer: {
            // 容器需要添加direction才能变成让子元素flex
            flexDirection: 'row',
            alignItems: 'center',
            justifyContent: 'center',
            // borderBottomColor: Color.border,
            // borderBottomWidth: 1,
            backgroundColor: '#fff'
        },
        cellCenter: {
            flex: 1,
            flexDirection: 'row',
            height: navBarStyle.navBarHeight,
            alignSelf: 'center',
            justifyContent: 'center',
        },
        cellLeft: {
            height: navBarStyle.navBarHeight,
            width: 88,
            alignSelf: 'center',
            justifyContent: 'flex-start'
        },
        cellRight: {
            height: navBarStyle.navBarHeight,
            width: 88,
            alignSelf: 'center',
            justifyContent: 'center'
        },
        clickableTextContainer: {
            flexDirection: 'row',
            alignItems: 'center',
            justifyContent: 'flex-end'
        },
        clickableTextTitle: {
            flex: 1,
            alignSelf: 'center',
            justifyContent: 'center',
            paddingRight: 0
            // fontSize: navBarStyle.navBarTitleFontSize,
          
        },
        clickableTextIcon: { //左侧的图标
            height:navBarStyle.navBarLeftIcon,
            width: navBarStyle.navBarLeftIcon,
            marginLeft:10,
            alignSelf: 'center',
            justifyContent: 'center',
            resizeMode: 'contain'
        },
        headerTitleImage: {
            width: 100,
            height: 30,
            alignSelf: 'center',
            resizeMode: 'stretch',
        },  
        clickableTextImage: {
            height: navBarStyle.navBarLeftIcon,
            width: navBarStyle.navBarLeftIcon,
            resizeMode: 'contain'
        },
        clickableTextTouch: {
            opacity: 0.5
        },
        leftImageContainer:{
            width:navBarStyle.navBarLeftIcon,
            height:navBarStyle.navBarLeftIcon,
            marginLeft:10,
            marginRight:6,
            justifyContent: 'center',
        },
        outerBox: {
            // height:50,
            height: navBarStyle.navBarHeight,
            flexDirection: 'row',
            backgroundColor: navBarStyle.navBarBg,
            // borderBottomWidth:1,
            // borderColor: Color.border
        },
         /* ********************左边样式  开始********************** */
        leftBox: {
            width: 60,
            justifyContent: 'center',
        },
        leftContent: {
            flexDirection: 'row',
            alignItems: 'center',
            //paddingLeft: 16,
            justifyContent: 'center',
        },
        leftImageContainer: {
            width:navBarStyle.navBarLeftIcon,
            height:navBarStyle.navBarLeftIcon,
            alignItems: 'center',
            justifyContent: 'center',
        },
        leftImage: {
            width:navBarStyle.navBarLeftIcon,
            height:navBarStyle.navBarLeftIcon,
            resizeMode: 'contain'
        },
        leftText: {
            height: 17,
        },
        /* ********************中间样式  开始********************** */

        middleBox: {
            flex: 1,
            //borderWidth:1,
            justifyContent: 'center',
            //alignSelf:'center',
        },  
         /* ********************右边样式  开始********************** */
        rightBox: {
            justifyContent: 'center',
            width: 100,
            //alignSelf:'center',
        },
        rightContent: {
            flex: 1,
            flexDirection: 'row',
    
        },
        btnOuter: {
            alignItems: 'center',
            justifyContent: 'center',
            // width: 42,
            // height: 44,
        },
        rightBtn: {
            // marginLeft:10,
            width: navBarStyle.navBarLeftIcon,
            height: navBarStyle.navBarLeftIcon,
            resizeMode: 'contain'
        },
    }
    return {
        navBarStyle,styles
    }
}

export { getNavBarStyle }